package dao.impl.jpa;

import java.util.List;

import dao.ReisDAO;
import domain.Reis;

public class ReisDAOImpl extends BasePersistence implements ReisDAO {

	@SuppressWarnings("unchecked")
	@Override
	public List<Reis> findAll() {
        open();
        List<Reis> set = em.createNamedQuery("Reis.findAll").getResultList();
        close();
		return set;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<Reis> findByReistype(String reistype) {
        open();
        List<Reis> set = em.createNamedQuery("Reis.findByReistype").setParameter("reistype", "%"+reistype+"%").getResultList();
        close();
		return set;
	}
}
